package com.xpsoft.oa.dao.produce.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.produce.MaterialPurchaseAdjustInfoDao;
import com.xpsoft.oa.model.produce.MaterialPurchaseAdjustInfo;

public class MaterialPurchaseAdjustInfoDaoImpl extends BaseDaoImpl<MaterialPurchaseAdjustInfo> implements MaterialPurchaseAdjustInfoDao{

	public MaterialPurchaseAdjustInfoDaoImpl() {
		super(MaterialPurchaseAdjustInfo.class);
	}

	@Override
	public void deleteMaterialPurchaseAdjustInfos(Long adjustId,
			List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from MaterialPurchaseAdjustInfo where id not in (:ids) and materialPurchaseAdjust.id=:adjustId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("adjustId", adjustId);
		query.executeUpdate();
	}

}